import com.itheima.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    @Test
    public void test(){
        //1 创建spring核心对象,加载spring配置文件
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        //2 调用核心对象的getBean方法获取我们的bean对象
        UserService userService = ac.getBean("userService", UserService.class);
        //3 执行bean对象的方法
        userService.save();
    }
}
